<?php

namespace Learn;

use Learn\Base\Behavior;

class DBBehavior extends Behavior
{
    public function getFirstRecord()
    {
        $fp = $this->owner->getFilePointer();
        $pos = ftell($fp);
        rewind($fp);
        $firstLine = fgets($fp);
        fseek($fp, $pos);
        return $firstLine;
    }
    public function onAfterInsert($row)
    {
        echo "Inserted (From " . __FUNCTION__ . ")\n";
    }
}
